home *** CD-ROM | disk | FTP | other *** search
/ Aminet 28 / Aminet 28 (1998)(GTI - Schatztruhe)[!][Dec 1998].iso / Aminet / game / board / Exchess.lha / EXChess / hash.h < prev    next >
C/C++ Source or Header  |  1998-06-29  |  1KB  |  45 lines

  1. /* header file for hash functions */
  2.  
  3. #define FLAG_A 1
  4. #define FLAG_B 2
  5. #define FLAG_P 3
  6. #define HASH_MISS -21000
  7. #define HASH_MOVE -21001
  8. #define PROBES 3
  9.  
  10. /* standard hash record - 16 bytes long */
  11. struct hash_rec
  12. {
  13.   unsigned long key;
  14.   int score;
  15.   char flag;
  16.   char depth;
  17.   move hmove;
  18.   short id;
  19. };
  20.  
  21. /* pawn hash record - 6 bytes long */
  22. struct pawn_rec
  23. {
  24.   unsigned long key;
  25.   short score;
  26.   char wfree_pawn;
  27.   char bfree_pawn;
  28. };
  29.  
  30. /* Number of hash related functions */
  31. void open_hash();
  32. void close_hash();
  33. void set_hash_size(int Mbytes);
  34. void put_pawn(h_code h_key, short score, char wfree_pawn, char bfree_pawn);
  35. void put_hash(h_code h_key, int score, int alpha, int beta, int depth, move hmove, int deep);
  36. int get_pawn(h_code h_key, char *wfree_pawn, char *bfree_pawn);
  37. int get_hash(h_code h_key, int alpha, int beta, int depth, int *hardalpha, int *hardbeta);
  38. int get_move(h_code h_key);
  39. h_code or(h_code A, h_code B);
  40. h_code gen_code(position *p);
  41. void start_code();
  42. float ran(long *idum);
  43.  
  44.  
  45.